describe("base", function() {

	beforeEach(function() {  
	  san.config.host="http://localhost/san/src/";  
	});

	it("base.require",function(){
		
		san.def("test.base.require",function(san){
			var Request=san.require("net.Request");
			expect(san.net.Request).toBeTruthy();
		},"net.Request");
	
	});


	it("base.isFirefox",function(){
		expect(san.isFirefox).toBeTruthy();
	});	
	
	it("base.isIE",function(){
		expect(san.isIE).toBeFalsy();
	});		
	
	
	it("base.isString",function(){
		var str1 = new String("i am string");
		var str2 = "i am string";
		expect(san.isString(str1)).toBeTruthy();
		expect(san.isString(str2)).toBeTruthy();
	});
	
	it("base.isArray",function(){
		var arr1 = new Array(1,2,3);
		var arr2 = [1,2,3];
		
		var obj1 = new Object();
		obj1.length = 1;
		
		expect(san.isArray(arr1)).toBeTruthy();
		expect(san.isArray(arr2)).toBeTruthy();
		expect(san.isArray(obj1)).toBeFalsy();
	});	

	it("base.isObject",function(){
		
		var arr1 = new Array(1,2,3);
		var str1 = new String("i am string");
		var obj1 = new Object();
		
		expect(san.isObject(obj1)).toBeTruthy();
		expect(san.isObject(arr1)).toBeFalsy();
		expect(san.isObject(str1)).toBeFalsy();
	});		

	it("base.isEmptyObject",function(){
		
		var obj1 = new Object();
		obj1.length = 1;
		
		var obj2 = new Object();
		
		expect(san.isEmptyObject(obj1)).toBeFalsy();
		expect(san.isEmptyObject(obj2)).toBeTruthy();
	});	
	
	it("base.isBoolean",function(){
		var bool1 = new Boolean();
		var bool2 = false;
		
		expect(san.isBoolean(bool1)).toBeTruthy();
		expect(san.isBoolean(bool2)).toBeTruthy();
	});		
	
	it("base.isEmpty",function(){
		var bool1 = new Boolean();
		var obj1 = new Object();
		var arr1 = new Array(1,2,3);
		
		expect(san.isEmpty(bool1)).toBeFalsy();
		expect(san.isEmpty(obj1)).toBeTruthy();
		expect(san.isEmpty(arr1)).toBeFalsy();
		expect(san.isEmpty(null)).toBeTruthy();
		expect(san.isEmpty(undefined)).toBeTruthy();
		expect(san.isEmpty([])).toBeTruthy();
		expect(san.isEmpty("")).toBeTruthy();
		expect(san.isEmpty("",true)).toBeFalsy();
	});

	it("base.isDate",function(){
		var date = new Date();
		
		expect(san.isDate(date)).toBeTruthy();
	});	


	it("base.isNumber",function(){
		var num1 = new Number();
		var num2 = 0;
		var num3 = Number.NaN;
		var num4 = Number.NEGATIVE_INFINITY;
		
		expect(san.isNumber(num1)).toBeTruthy();
		expect(san.isNumber(num2)).toBeTruthy();
		expect(san.isNumber(num3)).toBeFalsy();
		expect(san.isNumber(num4)).toBeFalsy();	
	});	
	

	it("base.namespace",function(){
		
		san.namespace("test.namespace",san);	
		expect(san.test.namespace).toBeTruthy();

	});
	

	
	it("base.isIterable",function(){
		
		expect(san.isIterable([])).toBeTruthy();
		//expect(san.isIterable(new NodeList)).toBeTruthy();

	});		

	it("base.toArray",function(){
		expect(san.toArray(arguments)).toEqual([]);		
		expect(san.toArray(1)).toEqual([1]);
		expect(san.toArray(true)).toEqual([true]);
		expect(san.toArray("true")).toEqual(["true"]);
		expect(san.toArray(null)).toEqual([]);
	});		

	it("base.each",function(){


	});	
			
  /*
  it("should be empty",function(){
  	expert(window.JSON.stringify(array)).toEqual("[]");
  });
  
  it("should be trim",function(){
  	var str ="   abc   ";
  	expert(str.trim()).toEqual("abc");
  });
  
  it("should be trim",function(){
   expect(player.isPlaying).toBeFalsy();
   expect(player.isPlaying).toBeTruthy();
   expect(song.persistFavoriteStatus).toHaveBeenCalledWith(true);
   expect(function() {
        player.resume();
   }).toThrow("song is already playing");
  });     
 */

});